<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhouyang
 * Date: 13-7-15
 * Time: 下午4:31
 * To change this template use File | Settings | File Templates.
 */
class CateHasRolesModel extends Model{
    //添加 cate 拥有的 role 信息
    public function addCateHasRoles($cate_id,$role_id){
        $ret = $this->dbreader()->addCateHasRoles($cate_id,$role_id);

        return $ret;
    }

    //删除 cate_id 对应的信息
    public function delByCateId($cate_id){
        $ret = $this->dbreader()->delByCateId($cate_id);

        return $ret;
    }

    //删除 role_id 对应的信息
    public function delByRoleId($role_id){
        $ret = $this->dbreader()->delByRoleId($role_id);

        return $ret;
    }

    //获取角色id对应的cate 信息
    public function getCateHasRoles($role_id){
        $ret = $this->dbreader()->getCateHasRoles($role_id);

        return $ret;
    }

    //获取用户所有的权限分类ID
    public function getCateIdsByUserId($user_id){
        $row = $this->dbreader()->getCateIdsByUserId($user_id);

        return $row;
    }
}